<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Requests\UserContext;
use App\Http\Services\UserCenterService;
use App\Http\Traits\ResponseJson;
use Illuminate\Http\Request;

class UserCenterController extends Controller
{
    use ResponseJson;

    protected $userCenterService;

    public function __construct(UserCenterService $userCenterService)
    {
        $this->userCenterService = $userCenterService;
    }

    public function userInfo(Request $request)
    {
        $data = $this->userCenterService->userInfo($request);
        return $this->returnJson($data);
    }

    public function updateUserInfo(UserContext $userContext)
    {
        $data = $this->userCenterService->updateUserInfo($userContext);
        return $this->returnJson($data);
    }


}
